﻿@model Home.Site.Models.DataLayer.Offer
@if (@ViewBag.Error != null)
{
    <div class="alert alert-error">
        @ViewBag.Error
    </div>
}
else if (@ViewBag.Success != null)
{
    <div class="alert alert-success">
        @ViewBag.Success 
        <a href="\Home\Contact"><i class="icon-repeat"></i></a>
    </div>
    <script>
        $(function () {
            $("#ajaxForm").hide();
        })
    </script>
}

<div id="ajaxForm">
    @using (Html.BeginForm("Create", "Offer", FormMethod.Post))
    {
        @Html.AntiForgeryToken()
        @Html.ValidationSummary(true)
        <div class="editor-field">
            @Html.HiddenFor(model => model.title)
            @Html.ValidationMessageFor(model => model.title)
        </div>
        <div class="alert alert-info">
            @Html.LabelFor(model => model.description, "Ваши отзывы и предложения:")
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.description, new { placeholder = "Пишите ваши отзывы и предложения...", style = "width: 400px;" })
            @Html.ValidationMessageFor(model => model.description)
        </div>
        <p>
            <input class="btn btn-success pull-right" style="position: relative;" type="submit" value="Отправить" /><a href="/Offer/All" class="btn btn-info">Перейти</a>
        </p>
    }
</div>
